function [Outputs,Fnk]=RFNNproTA(S,W)
    % 参数初始化
    numInputs=4;% 输入层节点数
    numMFsPerInput=2;% 每个输入的隶属度函数数
    numRules=16;% 模糊规则数
    numOutputs=2;% 输出层节点数
    % 初始化静态变量
    persistent pre_firingStrengths;
    if isempty(pre_firingStrengths)
            pre_firingStrengths =zeros(1,numRules);
    end
    %文献均值和标准差
    c=[0,0,-pi/2,-pi/2;
        10,5,pi/2,pi/2];
    sigma=[2.5,1,1,1];
    %输入向量
    %S=[dg,do,sig,sio];
    %设置权重
    %W=a*sum(S(:));
    % 隶属度层
    MFs = zeros(numMFsPerInput, numInputs);
    for i = 1:numInputs
        for j = 1:numMFsPerInput
            % 定义高斯隶属度函数的参数
            c_ij= c(j,i);%均值
            sigma_ij= sigma(i);%标准差
            MFs(j, i) = exp(-((S(i)-c_ij)^2)/(sigma_ij^2));
        end
    end
    % 模糊规则层
    firingStrengths = ones(1, numRules);
    for r = 1:numRules
        % 计算每条规则的激活程度（AND操作）
        switch r
            case 1
                firingStrengths(r)=MFs(1,1)*MFs(1,2)*MFs(1,3)*MFs(1,4);
            case 2
                firingStrengths(r)=MFs(1,1)*MFs(1,2)*MFs(1,3)*MFs(2,4);
            case 3
                firingStrengths(r)=MFs(1,1)*MFs(1,2)*MFs(2,3)*MFs(2,4);
            case 4
                firingStrengths(r)=MFs(1,1)*MFs(2,2)*MFs(2,3)*MFs(1,4);
            case 5
                firingStrengths(r)=MFs(1,1)*MFs(2,2)*MFs(1,3)*MFs(1,4);
            case 6
                firingStrengths(r)=MFs(1,1)*MFs(2,2)*MFs(1,3)*MFs(2,4);
            case 7
                firingStrengths(r)=MFs(1,1)*MFs(2,2)*MFs(2,3)*MFs(2,4);
            case 8
                firingStrengths(r)=MFs(1,1)*MFs(2,2)*MFs(2,3)*MFs(1,4);
            case 9
                firingStrengths(r)=MFs(2,1)*MFs(2,2)*MFs(1,3)*MFs(1,4);
            case 10
                firingStrengths(r)=MFs(2,1)*MFs(2,2)*MFs(1,3)*MFs(2,4);
            case 11
                firingStrengths(r)=MFs(2,1)*MFs(2,2)*MFs(2,3)*MFs(2,4);
            case 12
                firingStrengths(r)=MFs(2,1)*MFs(2,2)*MFs(2,3)*MFs(1,4);
            case 13
                firingStrengths(r)=MFs(2,1)*MFs(1,2)*MFs(1,3)*MFs(1,4);
            case 14
                firingStrengths(r)=MFs(2,1)*MFs(1,2)*MFs(1,3)*MFs(2,4);
            case 15
                firingStrengths(r)=MFs(2,1)*MFs(1,2)*MFs(2,3)*MFs(2,4);
            case 16
                firingStrengths(r)=MFs(2,1)*MFs(1,2)*MFs(2,3)*MFs(1,4);
        end
    end
    time_delay=zeros(1,numRules);
    now_firingStrengths=(ones(1,numRules)-time_delay).*firingStrengths+time_delay.*pre_firingStrengths;
    Fnk=now_firingStrengths;
    pre_firingStrengths=now_firingStrengths;
    %后件层
    Outputs = zeros(numOutputs, 1);
    for o = 1:numOutputs
        for r = 1:numRules
            % 线性组合
            Outputs(o) = Outputs(o) + now_firingStrengths(r) * W(o, r);
        end
    end
end